package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.user.UserInfo;
import com.atguigu.tingshu.model.user.UserPaidAlbum;
import com.atguigu.tingshu.model.user.UserPaidTrack;
import com.atguigu.tingshu.model.user.VipServiceConfig;
import com.atguigu.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(value = "service-user",path = "/api/user/rpc", fallback = UserInfoDegradeFeignClient.class)
public interface UserInfoFeignClient {

    /**
     * 根据指定用户id获取用户信息
     * @param userId 用户id
     * @return 用户信息
     */
    @GetMapping("getUserInfoVo/{userId}")
    Result<UserInfoVo> getUserInfoVo(@PathVariable(value = "userId") Long userId);


    /**
     * 根据用户id和专辑id，获取用户购买过的音频数据集合
     * @param userId 用户id
     * @param albumId 专辑id
     * @return 用户购买过的音频数据集合
     */
    @GetMapping("/getUserPaidTrackList/{userId}/{albumId}")
    Result<List<UserPaidTrack>> getUserPaidTrackList(@PathVariable(value = "userId") Long userId,
                                                            @PathVariable(value = "albumId") Long albumId);

    /**
     * 根据用户id和专辑id，获取用户购买过的专辑信息集合
     * @param userId 用户id
     * @param albumId 专辑id
     * @return 用户购买过的音频数据集合
     */
    @GetMapping("/getUserPaidAlbumList/{userId}/{albumId}")
    Result<List<UserPaidAlbum>> getUserPaidAlbumList(@PathVariable(value = "userId") Long userId,
                                                     @PathVariable(value = "albumId") Long albumId);


    /**
     * 根据vip套餐的id获取套餐信息
     * @param itemId 套餐id
     * @return 套餐信息
     */
    @GetMapping("/getVipConfigById/{itemId}")
    Result<VipServiceConfig> getVipConfigById(@PathVariable(value = "itemId") Long itemId);
}